#include <stdio.h>
void shell(int arr[], int len);

int main() {
	    int arr[] = { 22, 34, 3, 32, 82, 55, 89, 50, 37, 5, 64, 35, 9, 70 };
	        int len = (int) sizeof(arr) / sizeof(*arr);
		    shell(arr, len);
		        int i;
			    for (i = 0; i < len; i++)
				            printf("%d ", arr[i]);
			        return 0;
}




void shell(int arr[], int len) {
	    int gap, i, j;
	        int temp;
		    for (gap = len >> 1; gap > 0; gap = gap >> 1)
			            for (i = gap; i < len; i++) {
					                temp = arr[i];
							            for (j = i - gap; j >= 0 && arr[j] > temp; j -= gap)
									                    arr[j + gap] = arr[j];
								                arr[j + gap] = temp;
										        }
}




